//
//  ScrollCellView.m
//  MindBox
//
//  Created by MS on 16-1-3.
//  Copyright (c) 2016年 Lemon. All rights reserved.
//

#import "ScrollCellView.h"
#import "UIImageView+WebCache.h"
@interface ScrollCellView ()


@end

@implementation ScrollCellView

+(instancetype)scrollViewWithXib
{
      return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] lastObject];
}


-(void)setPmt:(Pmt *)pmt
{
    _pmt = pmt;
    [self.imageView sd_setImageWithURL:[NSURL URLWithString:pmt.image_url]];
    self.titleView.text = pmt.short_name;
    NSString * price = [NSString stringWithFormat:@"¥ %.2f",[pmt.p_price floatValue]];
    self.priceView.text = price;
    
    NSString * reduce = [NSString stringWithFormat:@"省%d元",(int)([pmt.price floatValue]-[pmt.p_price floatValue])];
    self.reduceView.text = reduce;
   
    
}


-(void)awakeFromNib
{
    self.reduceView.backgroundColor =[UIColor colorWithRed:0.98f green:0.33f blue:0.34f alpha:1.00f];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
